<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!-- 
        v-show: 指令的作用是根据真假切换元素的显示状态；
        原理是修改元素的display, 实现显示隐藏
     -->

    <script src="../js/vue.js"></script>

    <!-- v-show: true真 : false否 -->
    <div id="app">

        <h1 v-show="isShow">Vue.js狗都不学</h1>

        <input type="button" value="切换显示状态" @click="changeFood()">

    </div>

    <script>
        var app = new Vue({
            el: "#app",
            data: {
                isShow: false
            },
            methods: {
                changeFood() {
                    this.isShow = !this.isShow;
                }
            }
        })
    </script>
</body>

</html>